package com.shunan.miaosha.redis;

public abstract class BaseKeyPrefix implements KeyPrefix {
	
	private String prefix;
	private int  expire;
	
	
	public BaseKeyPrefix(String prefix, int expire) {
		super();
		this.prefix = prefix;
		this.expire = expire;
	}

	public BaseKeyPrefix(String prefix){
		this.prefix=prefix;
	}
	
	@Override
	public int expireSeconds() {
		return expire;
	}

	@Override
	public String getPrefix() {
		return getClass().getSimpleName()+":"+prefix;
	}

}
